class_name GridUtils
extends Node
const CELL_SIZE := 32
# 世界坐标-》网格坐标（带中心点修正）
static func world_to_grid(pos:Vector2) -> Vector2i:
	return Vector2i((pos/CELL_SIZE).floor())


# 网格坐标 => 世界坐标
static func grid_to_world(pos:Vector2i) -> Vector2:
	return Vector2(pos)*CELL_SIZE + Vector2(CELL_SIZE/2,CELL_SIZE/2)
